#!/usr/bin/env node
 // 命令行功具!
// console.log("hello,world")

const loading = require("loading-cli");
const chalk = require("chalk")

const load = loading({
    "text": "😊正在加载...",
    "color": "yellow",
    "interval": 100,
    "stream": process.stdout,
    "frames": ["◰", "◳", "◲", "◱"]
});

load.start();

const roundNum = (max, min) => Math.floor(Math.random() * (max - min + 1) + min);
const str = "雨打梨花深闭门，孤负青春，虚负青春。赏心乐事共谁论？"




// setInterval(() => {
//     load.text = "加载完成",
//         // load.color = "red"
//         console.log(chalk.rgb(roundNum(255, 0), roundNum(255, 0), roundNum(255, 0)).bold(str))
// }, 2000);

setTimeout(() => {
    load.text = "加载完成",
        // load.color = "red"
        console.log(chalk.rgb(roundNum(255, 0), roundNum(255, 0), roundNum(255, 0)).bold(str))
}, 2000);

// stop
setTimeout(function(){
    load.stop()
},2500)